package com.tchintech.pay.delegate;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.tchintech.pay.R;
import com.tchintech.pay.frame.view.AppDelegate;

import butterknife.Bind;

/**
 * Created by Administrator on 2017/7/7 0007.
 */

public class ScanOrderDelegate extends AppDelegate {

    @Bind(R.id.bt_wx)
    Button bt_wx;
    @Bind(R.id.bt_zfb)
    Button bt_zfb;
    @Bind(R.id.ed_je)
    EditText ed_je;
    @Bind(R.id.ed_spmc)
    EditText ed_spmc;
    @Bind(R.id.ed_spms)
    EditText ed_spms;
    @Bind(R.id.ed_ddms)
    EditText ed_ddms;
    @Bind(R.id.ed_bz)
    EditText ed_bz;
    @Bind(R.id.order_tv_tips)
    TextView orderTvTips;
    @Bind(R.id.tv_title)
    TextView textView;

    @Bind(R.id.iv_back)
    ImageView back;

    @Override
    public int getRootLayoutId() {
        return R.layout.activity_scanorder;
    }

    //异常提示消息
    public void setTip(String text) {
        orderTvTips.setText(text);

    }
    /**
     * 显示返回图片
     */
    public void setVisible() {
        back.setVisibility(View.VISIBLE);
    }

    /**
     * 设置title
     *
     * @param str
     */
    public void setTitle(String str) {
        textView.setText(str);
    }


    public String getText(int id) {
        String text = "";
        try {
            EditText et = get(id);
            text = et.getText().toString().trim();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return text;
    }

    ;

    public EditText getEdittView(int id) {
        EditText text = null;
        try {
            text = get(id);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return text;
    }

    ;

    public View getViews(int id) {
        View view = null;
        try {
            view = get(id);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return view;
    }
}
